-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: Resolve openSUSE RPM packaging issue with automatic group dependency #5216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3.0
Are you sure you want to change the base?
Conversation
…ency This commit resolves the packaging issue where RPM v4.20.1 in openSUSE 16 automatically creates a 'group(proxysql)' dependency when detecting useradd commands in %post scriptlets, causing installation failures. Problem: - RPM spec file used 'useradd -r -U' in %post scriptlet - This triggered automatic 'group(proxysql)' dependency generation - No package provides this virtual dependency, causing install to fail Solution: - Added systemd-sysusers configuration file (proxysql.conf) for user/group creation - Updated RPM spec to use proper openSUSE packaging guidelines: * Added %sysusers_requires and %sysusers_generate_pre macros * Modified %install section to install sysusers file * Removed manual useradd command from %post scriptlet * Added sysusers file to %files section Changes: - New file: docker/images/proxysql/suse-compliant/rpmmacros/rpmbuild/SPECS/proxysql.conf - Modified: docker/images/proxysql/suse-compliant/rpmmacros/rpmbuild/SPECS/proxysql.spec This follows openSUSE packaging guidelines for user/group management and ensures compatibility with newer RPM versions' stricter dependency handling. Fixes: #5183
Summary of ChangesHello @renecannao, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a critical RPM packaging issue specific to openSUSE 16, where the 'proxysql' package failed to install due to an automatically generated, unresolvable 'group(proxysql)' dependency. The fix involves a strategic shift from manual user creation to leveraging 'systemd-sysusers', a standard and robust method for managing system users and groups in modern Linux distributions. This ensures proper user provisioning and package compatibility with stricter dependency management systems. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly addresses the RPM packaging issue for openSUSE by replacing the manual useradd command with the systemd-sysusers mechanism. This is the modern and recommended approach to prevent automatic dependency issues. The implementation is mostly correct, but I have two suggestions for the proxysql.spec file to improve its robustness and adherence to packaging best practices.
|
|
||
| # systemd-sysusers macros for proper user/group handling | ||
| %sysusers_requires | ||
| %sysusers_generate_pre %{name}.conf $name %{name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the %sysusers_generate_pre macro, the second argument $name appears to be a shell variable, which might be unset during the execution of the %pre scriptlet. This could lead to incorrect user creation. It should likely be the RPM macro %{name} to ensure the package name proxysql is used for the user name, consistent with the third argument for the group name.
%sysusers_generate_pre %{name}.conf %{name} %{name}
| %{_bindir}/* | ||
| %{_sysconfdir}/systemd/system/%{name}.service | ||
| %{_sysconfdir}/systemd/system/%{name}-initial.service | ||
| %{_sysusersdir}/%{name}.conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to openSUSE packaging guidelines, files in /usr/lib/sysusers.d should be marked as configuration files. This prevents user customizations from being overwritten on package upgrades. You should mark this file with %config(noreplace) to align with this best practice and be consistent with other configuration files in this spec file.
%config(noreplace) %{_sysusersdir}/%{name}.conf
|
@mirostauder Could you please verify that this PR fixes the openSUSE packaging issue? The changes implement systemd-sysusers for user/group creation instead of using The solution follows openSUSE packaging guidelines by:
Please test this on your openSUSE 16 environment and let us know if it resolves the installation issue. Thanks! |
- Fix shell variable issue in %sysusers_generate_pre macro
Use %{name} instead of $name to ensure proper RPM macro expansion
- Mark sysusers file as %config(noreplace) in %files section
Protects user customizations from being overwritten on package upgrades
Follows openSUSE packaging guidelines
These improvements increase robustness and adherence to packaging best practices.
|



Summary
Fixes the RPM packaging issue in openSUSE 16 where RPM v4.20.1 automatically generates a
group(proxysql)dependency, causing installation failures.Problem
The RPM spec file used
useradd -r -Uin the%postscriptlet, which triggered automaticgroup(proxysql)dependency generation in newer RPM versions. Since no package provides this virtual dependency, installation fails with:Solution
Migrated to systemd-sysusers approach following openSUSE packaging guidelines:
proxysql.conf) for proper user/group creation%sysusers_requiresand%sysusers_generate_premacros%installsection to install sysusers fileuseraddcommand from%postscriptlet%filessectionChanges
docker/images/proxysql/suse-compliant/rpmmacros/rpmbuild/SPECS/proxysql.confdocker/images/proxysql/suse-compliant/rpmmacros/rpmbuild/SPECS/proxysql.specThis ensures compatibility with openSUSE 16's stricter dependency management while maintaining the same functionality.
Fixes: #5183